package logic.UIProxyBag.componentProxy
{
	import common.core.GEevnt;
	import common.core.UIService;
	import common.manager.GUI;
	import common.manager.ObserverEvt;
	
	import logic.def.Def;
	import logic.manager.UIProxy;
	import logic.ui.componentInfoMed.ComboBoxInfoMed;

	public class ComboBoxProxy extends UIService
	{
		public function ComboBoxProxy()
		{
		}
		
		public override function destory():void
		{
			
		}
		
		public override function start(value:* = null):void
		{
			UIProxy.stopAll();
			
			var ui : ComboBoxInfoMed = new ComboBoxInfoMed;
			
			GUI.add(ComboBoxInfoMed.NAME,ui);
			GUI.setAlgin(ComboBoxInfoMed.NAME,GUI.ALIGN_RIGHT,GUI.ALIGN_TOP);
			GUI.setOffest(ComboBoxInfoMed.NAME,Def.Offset_ComboBox_X,Def.Offset_ComboBox_Y);
			
			GUI.open(ComboBoxInfoMed.NAME);
			
			ObserverEvt.addRec(Def.COMPONENTPROPERTYCHANGED,this,onRecComponentPropertyChangedMsg);
		}
		
		public override function stop():void
		{
			GUI.remove(ComboBoxInfoMed.NAME);
			
			ObserverEvt.removeRec(Def.COMPONENTPROPERTYCHANGED,this,onRecComponentPropertyChangedMsg);
		}
		
		/**
		 * 收到属性面板目标属性改变的消息 
		 */		
		private function onRecComponentPropertyChangedMsg(evt : GEevnt) : void
		{
			(GUI.find(ComboBoxInfoMed.NAME) as ComboBoxInfoMed).setTargetData();
		}
	}
}